-
Notifications
You must be signed in to change notification settings - Fork 19
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Abstract sockets #470
Abstract sockets #470
Conversation
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
Signed-off-by: Vladimir Popov <vladimir.popov@xored.com>
@Mixaster995 Have you tested this with cmd-forwarder-vpp ? My initial testing with it is failing (though need to check to see if I'm adapting to it correctly to be sure). |
@edwarnicke yes, i tested it on equinix metal, everything worked fine. For correct testing we need to update and build images for Note: Calico doesn't work locally on kind (probably because of insufficient resources) |
@Mixaster995 Good to know its working on equinix metal. My point is: could you push your code that fixes up cmd-forwarder-vpp for this change so I can try running its unit tests to make sure they are working as expected? |
if: matrix.os != 'windows-latest' | ||
run: sudo -E PATH="$PATH" bash -c "go test -race ./..." | ||
- name: Test | ||
if: matrix.os == 'windows-latest' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you explain why this change?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test https://github.com/Mixaster995/sdk-vpp/blob/abstract-sockets/pkg/tools/proxy/proxy_test.go#L44
failes without these lines
The reason is creation of a new network namespace throws operation not permitted
on linux, so we have to use sudo, and this construction in ci passes correct envs to it.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Got it :)
) | ||
|
||
// nolint:gochecknoinits | ||
func init() { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why are we doing this in an init() ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
made some refactoring, removed init
method
retested that with that changes everything works on kind and also works with calico on equinix metal
Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
netNS netns.NsHandle | ||
netNSPath string | ||
once sync.Once | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mixaster995 these should not be global variables, they should be attributes of the chain(s) that use them.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edwarnicke made refactoring to remove usage of global variables - please, take a look
Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
@@ -79,6 +79,7 @@ func NewServer(ctx context.Context, name string, authzServer networkservice.Netw | |||
) | |||
nsClient := registryclient.NewNetworkServiceRegistryClient(ctx, clientURL, registryclient.WithDialOptions(clientDialOptions...)) | |||
|
|||
netNsInfo := memif.NewNetNSInfo() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mixaster995 Why are we doing this outside the memif.NewServer() ? If this can be safely done inside memif.NewServer it vastly simplifies the use of memif.NewServer...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@edwarnicke i was under impression that it was required for some logic, but was mistaken. Made some refactoring and tested all changes.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mixaster995 Its all good. When reworking someone else's work, its sometimes hard to figure out if something that looks weird is essential or not.
Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com>
…k-vpp@main PR link: networkservicemesh/sdk-vpp#470 Commit: 0fd2c25 Author: Авраменко Михаил Date: 2021-12-21 15:07:28 +0700 Message: - Abstract sockets (#470) * Rework memif to use abstract sockets Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add tests for proxy Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Rework memif to new api, add WithExternalVPP option Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * refactoring of init() Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactored to remove global variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactoring for not using shared variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k-vpp@main PR link: networkservicemesh/sdk-vpp#470 Commit: 0fd2c25 Author: Авраменко Михаил Date: 2021-12-21 15:07:28 +0700 Message: - Abstract sockets (#470) * Rework memif to use abstract sockets Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add tests for proxy Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Rework memif to new api, add WithExternalVPP option Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * refactoring of init() Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactored to remove global variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactoring for not using shared variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k-vpp@main PR link: networkservicemesh/sdk-vpp#470 Commit: 0fd2c25 Author: Авраменко Михаил Date: 2021-12-21 15:07:28 +0700 Message: - Abstract sockets (#470) * Rework memif to use abstract sockets Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add tests for proxy Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Rework memif to new api, add WithExternalVPP option Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * refactoring of init() Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactored to remove global variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactoring for not using shared variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k-vpp@main PR link: networkservicemesh/sdk-vpp#470 Commit: 0fd2c25 Author: Авраменко Михаил Date: 2021-12-21 15:07:28 +0700 Message: - Abstract sockets (#470) * Rework memif to use abstract sockets Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add tests for proxy Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Rework memif to new api, add WithExternalVPP option Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * refactoring of init() Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactored to remove global variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactoring for not using shared variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
…k-vpp@main PR link: networkservicemesh/sdk-vpp#470 Commit: 0fd2c25 Author: Авраменко Михаил Date: 2021-12-21 15:07:28 +0700 Message: - Abstract sockets (#470) * Rework memif to use abstract sockets Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Add tests for proxy Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * Rework memif to new api, add WithExternalVPP option Signed-off-by: Vladimir Popov <vladimir.popov@xored.com> * refactoring of init() Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactored to remove global variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> * refactoring for not using shared variables Signed-off-by: Mikhail Avramenko <avramenkomihail15@gmail.com> Signed-off-by: NSMBot <nsmbot@networkservicmesh.io>
Issue
part of #370
part of networkservicemesh/integration-k8s-kind#325